<?php
$currentPost = $args['currentPost'] ?? [];

if (empty($currentPost)) {
    $path = explode('/', $_SERVER['REQUEST_URI']);
    $currentPost = formatPost(intval(end($path)));
}
?>

<?php get_template_part('../blocks/location1', null, ['currentPost' => $currentPost]) ?>

<article class="grid mgtb">
    <h2><?= $currentPost['title'] ?></h2>
    <p><?= $currentPost['date'] ?></p>
    <?= $currentPost['content'] ?>
</article>

<?php get_template_part('../blocks/tags', null, ['tags' => $currentPost['tags'] ?? []]) ?>


<style>
    article {
        gap: var(--gap);
        justify-content: end;
        justify-items: end;
        background-color: var(--color-primary);
        padding: var(--gap);
    }

    article ol,
    article ul,
    article li {
        text-align: right;
        width: 100%;
    }

    article p {
        text-align: right;
        width: 100%;
    }

    article p img {
        margin: 0 auto;
    }

    div.location {
        display: flex;
        justify-content: end;
        font-weight: bold;
        gap: var(--gap);
    }
</style>